/*
 Copyright 2009 Abdulla Abdurakhmanov (abdulla@latestbit.com)
 Original sources are available at www.latestbit.com

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 CallInterfaceOperationResponse.hpp. Created on: 08.09.2009 18:03:38
 */

#ifndef CALLINTERFACEOPERATIONRESPONSE_HPP_
#define CALLINTERFACEOPERATIONRESPONSE_HPP_

#include "smartobjects/SmartObjectsDefs.hpp"
#include "StdNetworkCommand.hpp"

namespace smartobjects {

class CallInterfaceOperationResponse : public StdNetworkCommand {
public:

	enum ResponseFlags {
		EMPTY_FLAGS			=0,
		IS_EXCEPTION 		=1,
		INSTANCE_OBJECT_REF =2
	};

public:
	SO_DLLPRFX CallInterfaceOperationResponse(ByteBuffer* poToBuffer, IDataTypesCoder* poCoder);
	SO_DLLPRFX CallInterfaceOperationResponse(const INetworkCommand* poParentCommand);

	SO_DLLPRFX virtual ~CallInterfaceOperationResponse();

	SO_DLLPRFX void setExceptionFlag ( bool );
	SO_DLLPRFX bool isExceptionFlag ( );

	SO_DLLPRFX void setInstanceObjectRefFlag ( bool );
	SO_DLLPRFX bool isInstanceObjectRefFlag ( );

	SO_DLLPRFX void setExceptionInterfaceId ( const std::string& );
	SO_DLLPRFX const std::string& getExceptionInterfaceId ();
	SO_DLLPRFX void setExceptionMessage ( const std::string& );
	SO_DLLPRFX const std::string& getExceptionMessage ();

	SO_DLLPRFX void setInstanceObjectRef ( const std::string& );
	SO_DLLPRFX const std::string& getInstanceObjectRef ();

	SO_DLLPRFX virtual void deserialize();
	SO_DLLPRFX virtual void beginSerialize();

protected:

	unsigned int m_nResponseFlags;
	std::string m_sExceptionInterfaceId;
	std::string m_sExceptionMessage;
	std::string m_sInstanceObjectRef;

};

}

#endif /* CALLINTERFACEOPERATIONRESPONSE_HPP_ */
